import 'package:flutter/material.dart';
import 'package:yysk_app/utils/colors.dart';
import 'package:yysk_app/utils/helper.dart';

class EmptyWidget extends StatelessWidget {
  final String? emptyText;
  final String? icon;
  final double? iconWidth;
  final double? iconHeight;
  final double? fontSize;
  const EmptyWidget({
    super.key,
    this.emptyText = '暂无内容',
    this.icon = 'static/images/no_data.png',
    this.iconWidth = 174,
    this.iconHeight = 133,
    this.fontSize = 12,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.symmetric(vertical: 20.px),
      margin: EdgeInsets.only(top: 40.px),
      child: Center(
        child: Column(
          children: [
            Image(
              width: iconWidth?.px,
              height: iconHeight?.px,
              image: AssetImage(icon!),
              fit: BoxFit.cover,
            ),
            SizedBox(height: 20.px),
            Text(
              emptyText!,
              style: TextStyle(
                color: AppColors.fontColorA,
                fontSize: fontSize?.px,
              ),
            ),
          ],
        ),
      ),
    );
  }
}
